#ifndef CONVOLUTION_HH_
# define CONVOLUTION_HH_

# include "cv.h"
# include "highgui.h"
# include "tbb/blocked_range2d.h"
# include "tbb/parallel_for.h"

class ApplyConvolution {
  IplImage* input;
  /*
    ul uc ur
    ml mc mr
    bl bc br
   */
  int ul;//In %
  int uc;
  int ur;
  int ml;
  int mc;
  int mr;
  int bl;
  int bc;
  int br;
  IplImage* output;
public:
  ApplyConvolution (IplImage* input_,
		    int ul_,
		    int uc_,
		    int ur_,
		    int ml_,
		    int mc_,
		    int mr_,
		    int bl_,
		    int bc_,
		    int br_);

  void operator() (const tbb::blocked_range2d<int>& r) const;

  IplImage*
  getOutput ();
};

IplImage*
convolution (IplImage* input,
	     int ul,
	     int uc,
	     int ur,
	     int ml,
	     int mc,
	     int mr,
	     int bl,
	     int bc,
	     int br);

#endif /* !CONVOLUTION_HH_ */
